package com.aviccxzx.smarthome.UserModule;

import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.aviccxzx.smarthome.R;
import com.aviccxzx.smarthome.base.GosUserModuleBaseActivity;


/**
 * Created by joey on 2016/10/25.
 */
public class HelpActivity extends GosUserModuleBaseActivity implements View.OnClickListener {
    TextView no_one_an,no_one,no_two,no_two_an,no_three,no_three_an,no_four,no_four_an,no_five,no_five_an,no_six,no_six_an,no_seven,no_seven_an;
    Drawable arrow_up;
    Drawable arrow_down;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            setContentView(R.layout.help_lay_v19);
        } else {
        }
        initView();
    }

    private void initView() {
        ((TextView) findViewById(R.id.title_tv)).setText("帮助");
        findViewById(R.id.ll_title_left_view).setOnClickListener(this);

        no_one = (TextView) findViewById(R.id.no_one);
        no_one_an = (TextView) findViewById(R.id.no_one_an);

        no_two = (TextView) findViewById(R.id.no_two);
        no_two_an = (TextView) findViewById(R.id.no_two_an);

        no_three = (TextView) findViewById(R.id.no_three);
        no_three_an = (TextView) findViewById(R.id.no_three_an);

        no_four = (TextView) findViewById(R.id.no_four);
        no_four_an = (TextView) findViewById(R.id.no_four_an);

        no_five = (TextView) findViewById(R.id.no_five);
        no_five_an = (TextView) findViewById(R.id.no_five_an);

        no_six = (TextView) findViewById(R.id.no_six);
        no_six_an = (TextView) findViewById(R.id.no_six_an);

        no_seven = (TextView) findViewById(R.id.no_seven);
        no_seven_an = (TextView) findViewById(R.id.no_seven_an);



        no_one.setOnClickListener(this);
        no_two.setOnClickListener(this);
        no_three.setOnClickListener(this);
        no_four.setOnClickListener(this);
        no_five.setOnClickListener(this);
        no_six.setOnClickListener(this);
        no_seven.setOnClickListener(this);

        arrow_down = getResources().getDrawable(R.mipmap.arrow_blue_down);
        arrow_down.setBounds(0, 0, arrow_down.getMinimumWidth(), arrow_down.getMinimumHeight());
        arrow_up = getResources().getDrawable(R.mipmap.arrow_blue_up);
        arrow_up.setBounds(0, 0, arrow_up.getMinimumWidth(), arrow_up.getMinimumHeight());
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_title_left_view:
                finish();
                break;
            case R.id.no_one:
                if (no_one_an.getVisibility()==View.VISIBLE){
                    no_one.setCompoundDrawables(null, null, arrow_down, null);
                    no_one_an.setVisibility(View.GONE);
                }else {
                    no_one.setCompoundDrawables(null, null, arrow_up, null);
                    no_one_an.setVisibility(View.VISIBLE);
                }
                break;
            case R.id.no_two:
                if (no_two_an.getVisibility()==View.VISIBLE){
                    no_two.setCompoundDrawables(null, null, arrow_down, null);
                    no_two_an.setVisibility(View.GONE);
                }else {
                    no_two.setCompoundDrawables(null, null, arrow_up, null);
                    no_two_an.setVisibility(View.VISIBLE);
                }
                break;
            case R.id.no_three:
                if (no_three_an.getVisibility()==View.VISIBLE){
                    no_three.setCompoundDrawables(null, null, arrow_down, null);
                    no_three_an.setVisibility(View.GONE);
                }else {
                    no_three.setCompoundDrawables(null, null, arrow_up, null);
                    no_three_an.setVisibility(View.VISIBLE);
                }
                break;
            case R.id.no_four:
                if (no_four_an.getVisibility()==View.VISIBLE){
                    no_four.setCompoundDrawables(null, null, arrow_down, null);
                    no_four_an.setVisibility(View.GONE);
                }else {
                    no_four.setCompoundDrawables(null, null, arrow_up, null);
                    no_four_an.setVisibility(View.VISIBLE);
                }
                break;
            case R.id.no_five:
                if (no_five_an.getVisibility()==View.VISIBLE){
                    no_five.setCompoundDrawables(null, null, arrow_down, null);
                    no_five_an.setVisibility(View.GONE);
                }else {
                    no_five.setCompoundDrawables(null, null, arrow_up, null);
                    no_five_an.setVisibility(View.VISIBLE);
                }
                break;
            case R.id.no_six:
                if (no_six_an.getVisibility()==View.VISIBLE){
                    no_six.setCompoundDrawables(null, null, arrow_down, null);
                    no_six_an.setVisibility(View.GONE);
                }else {
                    no_six.setCompoundDrawables(null, null, arrow_up, null);
                    no_six_an.setVisibility(View.VISIBLE);
                }
                break;
            case R.id.no_seven:
                if (no_seven_an.getVisibility()==View.VISIBLE){
                    no_seven.setCompoundDrawables(null, null, arrow_down, null);
                    no_seven_an.setVisibility(View.GONE);
                }else {
                    no_seven.setCompoundDrawables(null, null, arrow_up, null);
                    no_seven_an.setVisibility(View.VISIBLE);
                }
                break;
        }
    }

}
